﻿package mortal.game.model
{
    import mortal.game.rules.*;

    public class TaskTargetInfo extends Object
    {
        public var id:int;
        public var mapId:int;
        public var x:int;
        public var y:int;
        public var proxyId:int;
        public var serverId:int;
        public var targetType:int;
        public var name:String = "null";
        public var mapName:String = "null";
        public var camp:int;
        public var pathGuide:Boolean;
        public var curValue:int;
        public var totalValue:int;
        public var mapType:int;

        public function TaskTargetInfo()
        {
            return;
        }// end function

        public function checkTargetPoint() : Boolean
        {
            if (this.mapId > 0)
            {
                if (this.x > 0 && this.y > 0 || this.targetType == EntityType.Scene)
                {
                    return true;
                }
            }
            return false;
        }// end function

        public function checkValue() : Boolean
        {
            return this.curValue != 0 && this.curValue >= this.totalValue;
        }// end function

        public function isCrossCountryMap() : Boolean
        {
            return false;
        }// end function

        public function toString() : String
        {
            return this.id + "-" + this.mapId + "-" + this.x + "-" + this.y;
        }// end function

        public function clone(param1:TaskTargetInfo = null) : TaskTargetInfo
        {
            if (param1 == null)
            {
                param1 = new TaskTargetInfo();
            }
            param1.targetType = this.targetType;
            param1.mapId = this.mapId;
            param1.id = this.id;
            param1.x = this.x;
            param1.y = this.y;
            param1.proxyId = this.proxyId;
            param1.serverId = this.serverId;
            param1.name = this.name;
            param1.mapName = this.mapName;
            param1.camp = this.camp;
            return param1;
        }// end function

    }
}
